define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'order.goods/index',
        add_url: 'order.goods/add',
        edit_url: 'order.goods/edit',
        delete_url: 'order.goods/delete',
        export_url: 'order.goods/export',
        modify_url: 'order.goods/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},                    {field: 'id', title: 'id'},                    {field: 'order_id', title: '订单id'},                    {field: 'goods_name', title: '商品名称'},                    {field: 'spec_no', title: '规格编码'},                    {field: 'barcode', title: '条形码'},                    {field: 'price', title: '商品单价'},                    {field: 'feedback_num', title: '反馈产品数量'},                    {field: 'num', title: '数量'},                    {field: 'supplier_name', title: '供应商名称'},                    {field: 'supplier_price', title: '供应商价格'},                    {field: 'quality_problem', title: '质量问题类型'},                    {field: 'create_time', title: '创建时间'},                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});